function getValues() public view returns(string memory,
string memory) {
return (value1, value2);
}
function setValue(string memory newValue1, string memory
newValue2) public {
value1 = newValue1;
value2 = newValue2;
}
}
When a function has multiple return types, the statement return (v0,
v1, …, vn) can be used to return multiple values. The number of
components must be the same as the number of return variables
and their types have to match.
2.5.8.4 Order of Functions
In a Solidity file, the functions should be ordered as per their visibility,
as follows:
constructor
fallback function (if exists)
external
public
internal
private
2.5.9 Variables
In terms of accessibility and storage locations, the variables in
Solidity can be divided into three types, which are as follows:
1. State Variables
2. Local Variables
3. Global Variables